"""
# String Process
@ Eugene.Complexa.Ares
! MIT License
~ Please process two input strings according to the following rules:
1) merge the two string (pure, withour "");
2) sort the merged string in the order of ascending, where the character with odd index should be ahead of the character with even index;
3) ‘reverse’ the sorted string: for each character , ‘0’-‘9’ or ‘A’-‘F’, or ‘a’-‘f’, of the string, convert it to hexadecimal bits then reverse the bits.
"""


def transH2B(chara):
  if chara == '0':
    return '0000'
  elif chara == '1':
    return '0001'
  elif chara == '2':
    return '0010'
  elif chara == '3':
    return '0011'
  elif chara == '4':
    return '1000'
  
def reverseH(chara):
  if chara == '0':
    return '0'
  if chara == '1':
    return '8'
  if chara == '2':
    return '4'
  if chara == '3':
    return 'c'
  if chara == '4':
    return '2'
  if chara == '5':
    return 'a'
  if chara == '6':
    return '6'
  if chara == '7':
    return 'e'
  if chara == '8':
    return '1'
  if chara == '9':
    return '9'
  if chara == 'A' or chara == 'a':
    return '5'
  if chara == 'B' or chara == 'b':
    return 'd'
  if chara == 'C' or chara == 'c':
    return '3'
  if chara == 'D' or chara == 'd':
    return 'b'
  if chara == 'E' or chara == 'e':
    return '7'
  if chara == 'F' or chara == 'f':
    return 'f'

# not sure    
def isnumidodd(chara):
  if chara in ['0','2','4','6','8','a','A','c','C','e','E']:
    return True
  elif chara in ['1','3','5','7','9','b','B','d','D','f','F']:
    return False
  else:
    print("error charactor")
    return False
    
def sortasc(stri):
  ls = list(stri)
  ls.sort()
  striout = "".join(ls)
  return striout
 
def sortascodd(stri):
  striodd = ''
  strieven = ''
  for chara in stri:
    if isnumidodd(chara):
      striodd += chara
    else:
      strieven += chara
  strioutodd = sortasc(striodd)
  striouteven = sortasc(strieven)
  striout = strioutodd + striouteven    # odd index should be ahead of the character with even index
  return striout

def sortascindexodd(stri):
  striodd = ''
  strieven = ''
  for i in range(len(stri)):
    if i%2 == 0:
      strieven += stri[i]
    else:
      striodd += stri[i]
  strioutodd = sortasc(striodd)
  striouteven = sortasc(strieven)
  striout = strioutodd + striouteven    # odd index should be ahead of the character with even index
  return striout


def reversebychar(stri):
  rstri = '' 
  for chara in stri:
    rstri+=reverseH(chara)
  return rstri


if __name__ == '__main__':
  row1=input().lower();
  row2=input().lower();
  #len1=len(row1)
  #len1=len(row1)
  row = row1 + row2  # merge
  rowout = sortascodd(row)
  print(reversebychar(rowout))